package com.huayue.service;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.huayue.dao.RoomChangeDao;
import com.huayue.entity.RoomChange;

/**
 * 换房
 */
@Service
public class RoomChangeService {
    @Autowired
    RoomChangeDao dao;

    public Map<String, Object> findOneRoom(RoomChange roomChange) {
        return dao.findOneRoom(roomChange);
    }

    public List<Map<String, Object>> findTypeRoom(RoomChange roomChange) {
        return dao.findTypeRoom(roomChange);
    }

    public int updateNewRoomStatus(RoomChange roomChange) {
        return dao.updateNewRoom(roomChange);
    }

    public int updateOldRoomStatus(RoomChange roomChange) {
        return dao.updateOldRoom(roomChange);
    }

    public List<Map<String, Object>> findType() {
        return dao.findType();
    }

    public int updateRealDetails(Integer rid, RoomChange roomChange) {
        return dao.updateRealDetails(rid, roomChange);
    }

    public int insertNewRealDetails(int rid, int cid, RoomChange roomChange) {
        return dao.insertNewRealDetails(rid, cid, roomChange);
    }

    public int insertOldRealDetails(int rid, int cid, RoomChange roomChange) {
        return dao.insertOldRealDetails(rid, cid, roomChange);
    }

    public Map<String, Object> findRoomReal(RoomChange roomChange) {
        return dao.findRoomReal(roomChange);
    }

    // 将原房间押金转至新房间
    public int updateRoomDeposit(Integer orderId, Integer oldRoomId, Integer newRoomId) {
        return dao.updateRoomDeposit(orderId, oldRoomId, newRoomId);
    }

    public int findOverDaysByRoomId(Integer roomId) {
        return dao.findOverDaysByRoomId(roomId);
    }
}
